﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Card.Manager
{
    public partial class MemberManager : BasePage
    {
        #region
        private int Records
        {
            get
            {
                int _Records = 50;
                if (int.TryParse(this.txtRecords.Text, out _Records) && _Records > 0)
                {
                    return _Records;
                }
                else
                {
                    this.txtRecords.Text = "50";
                    return 50;
                }
            }
        }
        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.DoInit();
            }
        }

        private void DoInit()
        {
            this.rptList.DataSource = BLL.UsersManager.GetList(this.txtQuery.Text, this.Records);
            this.rptList.DataBind();
        }

        protected void btnQuery_Click(object sender, EventArgs e)
        {
            this.DoInit();
        }
    }
}
